package api;

/**
 * @program: baseModule
 * @description:
 * @author: zhanghz001
 * @create: 2020-10-23 14:09
 **/
public class People {
    private String name;
    private int age;

    public People(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "People{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    // @Override
    // public boolean equals(Object o) {
    //     if (this == o) return true;
    //     if (o == null || getClass() != o.getClass()) return false;
    //
    //     People people = (People) o;
    //
    //     if (age != people.age) return false;
    //     return name != null ? name.equals(people.name) : people.name == null;
    // }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + age;
        return result;
    }
}
